﻿using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;

namespace FwProject.Migrations
{
    public partial class _2018519 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_DistributionInfoDetails_RestaurantTypenNumberInfo_RestaurantTypenNumberInfo",
                table: "DistributionInfoDetails");

            migrationBuilder.DropIndex(
                name: "IX_DistributionInfoDetails_RestaurantTypenNumberInfo",
                table: "DistributionInfoDetails");

            migrationBuilder.DropColumn(
                name: "RestaurantTypenNumberInfo",
                table: "DistributionInfoDetails");

            migrationBuilder.CreateIndex(
                name: "IX_DistributionInfoDetails_RestaurantTypenNumberInfoId",
                table: "DistributionInfoDetails",
                column: "RestaurantTypenNumberInfoId");

            migrationBuilder.AddForeignKey(
                name: "FK_DistributionInfoDetails_RestaurantTypenNumberInfo_RestaurantTypenNumberInfoId",
                table: "DistributionInfoDetails",
                column: "RestaurantTypenNumberInfoId",
                principalTable: "RestaurantTypenNumberInfo",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_DistributionInfoDetails_RestaurantTypenNumberInfo_RestaurantTypenNumberInfoId",
                table: "DistributionInfoDetails");

            migrationBuilder.DropIndex(
                name: "IX_DistributionInfoDetails_RestaurantTypenNumberInfoId",
                table: "DistributionInfoDetails");

            migrationBuilder.AddColumn<Guid>(
                name: "RestaurantTypenNumberInfo",
                table: "DistributionInfoDetails",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.CreateIndex(
                name: "IX_DistributionInfoDetails_RestaurantTypenNumberInfo",
                table: "DistributionInfoDetails",
                column: "RestaurantTypenNumberInfo");

            migrationBuilder.AddForeignKey(
                name: "FK_DistributionInfoDetails_RestaurantTypenNumberInfo_RestaurantTypenNumberInfo",
                table: "DistributionInfoDetails",
                column: "RestaurantTypenNumberInfo",
                principalTable: "RestaurantTypenNumberInfo",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
